//
//  RQDropDownMenu.h
//  RQDropDownMenuDemo
//
//  Created by 蜂巢网络科技 on 2017/6/22.
//  Copyright © 2017年 fengchao. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RQIndexPath.h"

@class RQDropDownMenu;
@protocol RQDropDownMenuDataSource <NSObject>
@optional
// 组数 column表示菜单栏是第几组
- (NSInteger)numberOfColumnsInMenu:(RQDropDownMenu *)menu;

// 菜单栏标题
- (NSString *)menu:(RQDropDownMenu *)menu titleForColumn:(NSInteger)column;

// 返回 每组子菜单下有多少条数据,有多少分组
- (NSInteger)menu:(RQDropDownMenu *)menu numberOfRowsInColumn:(NSInteger)column  section:(NSInteger)section;

// 返回 每组子菜单下每条数据显示的文本
- (NSString *)menu:(RQDropDownMenu *)menu titleForRowAtIndexPath:(RQIndexPath *)indexPath;

// 是否需要显示为UICollectionView 默认为否
- (BOOL)displayByCollectionViewInColumn:(NSInteger)column;

// UICollectionView有多少分组
- (NSInteger)numberOfSectionInCollectionViewMenu:(RQDropDownMenu *)menu column:(NSInteger)column;

// UICollectionView分组的标题
- (NSString *)menu:(RQDropDownMenu *)menu titleForSection:(NSInteger)section column:(NSInteger)column;

// 判断当前cell是否需要多选
- (BOOL)menu:(RQDropDownMenu *)menu isMultipleAtIndexPath:(RQIndexPath *)indexPath;

@end

#pragma mark - delegate
@protocol RQDropDownMenuDelegate <NSObject>
@optional
- (void)menu:(RQDropDownMenu *)menu didSelectRowAtIndexPath:(RQIndexPath *)indexPath;
- (void)menu:(RQDropDownMenu *)menu column:(NSInteger)column didSelectCollectionCellWithDictionary:(NSDictionary *)selectDict;
- (void)menu:(RQDropDownMenu *)menu resetDataWithColumn:(NSInteger)column;
@end


@interface RQDropDownMenu : UIView

@property (nonatomic, weak) id <RQDropDownMenuDataSource> dataSource;
@property (nonatomic, weak) id <RQDropDownMenuDelegate> delegate;
@property (nonatomic, strong) UIColor *indicatorColor;
@property (nonatomic, strong) UIColor *textColor;
@property (nonatomic, strong) UIColor *separatorColor;

- (instancetype)initWithOrigin:(CGPoint)origin andHeight:(CGFloat)height;

@end
